package cn.ilikes.tools.hbase.jpa.indexs;

import java.util.List;

import org.apache.lucene.index.IndexNotFoundException;

import cn.ilikes.tools.hbase.jpa.clients.nodes.Node;
import cn.ilikes.tools.hbase.jpa.metadatas.IEntityMetaData;

public class JPAHBaseIndexer implements Indexer {

	private Indexer indexer;

	public JPAHBaseIndexer(Indexer indexer) {
		super();
		this.indexer = indexer;
	}

	@Override
	public void removeById(IEntityMetaData metadata, Object id) throws IndexingException {
		indexer.removeById(metadata, id);

	}

	@Override
	public void create(Node node) throws IndexingException {
		indexer.create(node);

	}

	@Override
	public void index(Node node) throws IndexingException {
		indexer.index(node);

	}

	@Override
	public void update(Node node) throws IndexingException {
		indexer.update(node);

	}

	@Override
	public List<Object> search(String luceneQuery, int start, int count, IEntityMetaData metadata, boolean fetchRelation) throws IndexingException {

		return indexer.search(luceneQuery, start, count, metadata, fetchRelation);
	}

	@Override
	public boolean entityExistsById(Class<?> entityClass, Object id) throws IndexingException, IndexNotFoundException {

		return indexer.entityExistsById(entityClass, id);
	}

	@Override
	public boolean entityExistsByEntity(Node node) throws IndexingException {

		return indexer.entityExistsByEntity(node);
	}

	@Override
	public void close() {
		indexer.close();

	}

	@Override
	public void flush() {
		indexer.flush();

	}

	@Override
	public long selectTotalByEntity(Node node) throws IndexingException {

		return indexer.selectTotalByEntity(node);
	}

	@Override
	public long selectTotalByEntityId(Class<?> entityClass, Object id) throws IndexingException {

		return indexer.selectTotalByEntityId(entityClass, id);
	}

	@Override
	public void removeAllIndexByEntity(Class<?> entityEntiity) throws IndexingException {
		indexer.removeAllIndexByEntity(entityEntiity);

	}

	@Override
	public void remove(Node node) throws IndexingException {
		indexer.remove(node);

	}

	@Override
	public <V> List<V> search(String luceneQuery, int start, int count, IEntityMetaData metadata) throws IndexingException {

		return indexer.search(luceneQuery, start, count, metadata);
	}

}
